package reflect;

import java.lang.reflect.Method;



public class ReflectDemo7 {
    public static void main(String[] args) throws Exception {
        Person p=new Person();
        Class cls1=p.getClass();
        Method method=cls1.getDeclaredMethod("hehe");
        Object obj=cls1.newInstance();
        method.setAccessible(true);
        method.invoke(obj);
        method.setAccessible(false);

    }
}
